package cc.miwuya.community.api;

import cc.miwuya.common.util.Result;
import cc.miwuya.community.domain.Property;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author 迷雾森林
 * @Date 2024-02-24 10:10
 * 物业操作api
 */
public interface PropertyApi {

    /**
     * 获取物业列表
     *
     * @return
     */
    @GetMapping("/community/property/list")
    public Result list();

    /**
     * 根据ID获取物业信息
     *
     * @param id
     * @return
     */
    @GetMapping("/community/property/info/{id}")
    public Result info(@PathVariable Long id);

    /**
     * 添加或修改物业信息
     *
     * @param property
     * @return
     */
    @PostMapping("/community/property/add")
    public Result add(Property property);

    @GetMapping("/community/property/delete/{id}")
    public Result delete(@PathVariable Long id);

    /**
     * 根据用户ID获取用户管理的物业Id
     */
    @GetMapping("/community/user/getPropertyByUserid/{userId}")
    public Long getPropertyByUserid(@PathVariable Long userId);
    @GetMapping("/community/property/listAll")
    public Result listAll();
    @GetMapping("/community/property/total")
    public Long total();
}
